Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Locate  a  Word  in  a  Text  File  and  Then  Echo  Back  That  Word  and  Any  Remaining  Text  

 Content of Locate a Word in a Text File and Then Echo Back That Word and Any Remaining Text.vbs
MD5 Hash: 681B948BE70E669EB5A6521BFE3BA7AD
Const ForReading = 1

Set obJFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Scripts\Test.txt", ForReading)

strContents = objFile.ReadAll
objFile.Close

arrWords = Split(strContents, " ")
intStart = 0

For Each strWord in arrWords
If InStr(strWord, "telescope") Then
intStart = intStart + 1
End If

If intStart > 0 Then
strFinalText = strFinalText & strWord & " "
End If
Next

Wscript.Echo strFinalText



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a